open AFILE, "<C:\\Documents and Settings\\R19338\\Desktop\\3.txt";
my %lines;
while(<AFILE>) {
	chomp;
    $lines{$_} = $_;
}

open EFILE, "<C:\\Documents and Settings\\R19338\\Desktop\\zu_au_backup.xml";
open WFILE, ">C:\\Documents and Settings\\R19338\\Desktop\\0.txt";

while(<EFILE>) {
	$file_contents .= $_;
	if ($file_contents =~ /(<product>.*?<\/product>)/is){
		my $one_product = $1;
		$file_contents = '';
		if ($one_product =~ /<ProductId>(.*?)<\/ProductId>/is) {
			if (exists($lines{$1})) {
				print WFILE "$one_product\n";
	    	}
		}
	}
}